﻿@using Contoso.Domain;
@model Contoso.Domain.Student 

@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<fieldset>
    <legend>Student</legend>

    <div class="display-label">LastName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.LastName)
    </div>

    <div class="display-label">FirstMidName</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FirstMidName)
    </div>

    <div class="display-label">EnrollmentDate</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.EnrollmentDate)
    </div>
    <br />
    <div class="display-field">
        <table>
            <tr>
                <th>Course Title</th>
                <th>Grade</th>
            </tr>
            @foreach (var item in Model.Enrollments)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Course.Title)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Grade)
                    </td>
                </tr>
            }
        </table>
    </div>
</fieldset>
<p>
    @Html.ActionLink("Edit", "Edit", new { id=Model.PersonID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
